import { InputType, Field, ID } from '@nestjs/graphql';
import { IsNotEmpty, ArrayMinSize, IsArray } from 'class-validator';
import { Type } from 'class-transformer';

@InputType()
export class CreateAccountRoleInput {
    @Field(type => ID, { nullable: false, description: '账号id' })
    @Type(() => Number)
    @IsNotEmpty({ message: '账号id不能为空' })
    accountId: number

    @Field(type => [ID], { description: '角色id数组' })
    @Type(() => Number)
    @ArrayMinSize(1, { message: '角色必须有一个' })
    @IsArray({ message: '角色列表必须是一个数组' })
    @IsNotEmpty({ message: '角色id不能为空' })
    roleIdList: number[]
}
